from handler import loginHandler, noticeHandler, chatHandler, ackHandler
from protoc.command import Command

'''
    消息分发处理器
'''

def process(head,msgBody):

    print(head)
    print(msgBody)

    cmd = head.cmd
    #用户登录
    if cmd == Command.UserLogin:
        #LoginHandler(head,msgBody).start()
        loginHandler.process(head,msgBody)
    #添加好友
    elif cmd == Command.Notice:
        noticeHandler.process(head, msgBody)
    elif cmd == Command.ChatMsg:
        chatHandler.process(head,msgBody)
    elif cmd == Command.Ack:
        ackHandler.process(head,msgBody)

